package com.xingkeduo.util.pojo.base;

import java.util.Date;

/**
 * 查询基类
 * 
 * @author GJ
 * @time 2017年12月18日 上午10:27:14
 * @description
 */
public class BaseQuery<Q extends BaseQuery<Q>> {
	protected long id;
	protected long code;
	protected int pageNo;
	protected int pageSize;
	protected int recordStart;
	protected int recordEnd;
	protected Date timeStart;
	protected Date timeEnd;
	protected String groupBy;
	protected String orderBy;

	protected boolean isSuperEmpty() {
		if (id != 0 || code != 0 || pageNo != 0 || pageSize != 0 || recordStart != 0 || recordEnd != 0
				|| timeStart != null || timeEnd != null)
			return false;

		return true;
	}

	public long getId() {
		return id;
	}

	public Q setId(long id) {
		this.id = id;
		return (Q) this;
	}

	public long getCode() {
		return code;
	}

	public Q setCode(long code) {
		this.code = code;
		return (Q) this;
	}

	public int getPageNo() {
		return pageNo;
	}

	public Q setPageNo(int pageNo) {
		this.pageNo = pageNo;
		return (Q) this;
	}

	public int getPageSize() {
		return pageSize;
	}

	public Q setPageSize(int pageSize) {
		this.pageSize = pageSize;
		return (Q) this;
	}

	public int getRecordStart() {
		return recordStart;
	}

	public Q setRecordStart(int recordStart) {
		this.recordStart = recordStart;
		return (Q) this;
	}

	public int getRecordEnd() {
		return recordEnd;
	}

	public Q setRecordEnd(int recordEnd) {
		this.recordEnd = recordEnd;
		return (Q) this;
	}

	public Date getTimeStart() {
		return timeStart;
	}

	public Q setTimeStart(Date timeStart) {
		this.timeStart = timeStart;
		return (Q) this;
	}

	public Date getTimeEnd() {
		return timeEnd;
	}

	public Q setTimeEnd(Date timeEnd) {
		this.timeEnd = timeEnd;
		return (Q) this;
	}

	public String getGroupBy() {
		return groupBy;
	}

	public Q setGroupBy(String groupBy) {
		this.groupBy = groupBy;
		return (Q) this;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public Q setOrderBy(String orderBy) {
		this.orderBy = orderBy;
		return (Q) this;
	}
}
